{"action":"created","issue":{"url":"https://api.github.com/repos/sepulworld/aptly_cli/issues/98","repository_url":"https://api.github.com/repos/sepulworld/aptly_cli","labels_url":"https://api.github.com/repos/sepulworld/aptly_cli/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/sepulworld/aptly_cli/issues/98/comments","events_url":"https://api.github.com/repos/sepulworld/aptly_cli/issues/98/events","html_url":"https://github.com/sepulworld/aptly_cli/pull/98","id":165803551,"number":98,"title":"Add prompting mechanism for config values and add global options: --config, --server, --username, --password, --debug","user":{"login":"msabramo","id":305268,"avatar_url":"https://avatars.githubusercontent.com/u/305268?v=3","gravatar_id":"","url":"https://api.github.com/users/msabramo","html_url":"https://github.com/msabramo","followers_url":"https://api.github.com/users/msabramo/followers","following_url":"https://api.github.com/users/msabramo/following{/other_user}","gists_url":"https://api.github.com/users/msabramo/gists{/gist_id}","starred_url":"https://api.github.com/users/msabramo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msabramo/subscriptions","organizations_url":"https://api.github.com/users/msabramo/orgs","repos_url":"https://api.github.com/users/msabramo/repos","events_url":"https://api.github.com/users/msabramo/events{/privacy}","received_events_url":"https://api.github.com/users/msabramo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-07-15T14:45:59Z","updated_at":"2016-07-17T16:07:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sepulworld/aptly_cli/pulls/98","html_url":"https://github.com/sepulworld/aptly_cli/pull/98","diff_url":"https://github.com/sepulworld/aptly_cli/pull/98.diff","patch_url":"https://github.com/sepulworld/aptly_cli/pull/98.patch"},"body":"This allows not keeping passwords and such in the config file.\r\n\r\nE.g.: In `/etc/aptly-cli.conf`:\r\n\r\n```yaml\r\n---\r\n:proto: http\r\n:server: 10.3.0.46\r\n:port: 8082\r\n:debug: false\r\n:username: ${PROMPT}\r\n:password: ${PROMPT_PASSWORD}\r\n```\r\n\r\nThe tool will prompt for the specified values, where `${PROMPT}` results in a regular prompt and `${PROMPT_PASSWORD}` results in a password prompt where the input is replaced by asterisks -- e.g.:\r\n\r\n```\r\n$ aptly-cli version\r\nEnter a value for username:\r\nzane\r\nEnter a value for password:\r\n***************\r\n{\"Version\"=>\"0.9.7\"}\r\n```\r\n\r\nThis also eliminates a bunch of duplicated code in all of the command classes by having them inherit from a common base class. This was actually essential because otherwise, every required file would trigger a config load and thus prompting for any needed values over and over again.\r\n\r\nThe `--config` (`-c`) option allows specifying an alternative config file -- e.g.:\r\n\r\n```\r\n$ aptly-cli -c ~/.config/aptly-cli/aptly-cli.conf repo_list\r\n```\r\n\r\nand the `--server`, `--username`, and `--password` options allow specifying those things on the command-line and not even requiring a config file:\r\n\r\n```\r\n$ aptly-cli --server 10.3.0.46 --username marca --password '${PROMPT_PASSWORD}' repo_list\r\n```\r\n\r\nNote that you can use `${PROMPT}` and `${PROMPT_PASSWORD}` in the values of these options, just as you can in a config file."},"comment":{"url":"https://api.github.com/repos/sepulworld/aptly_cli/issues/comments/233189370","html_url":"https://github.com/sepulworld/aptly_cli/pull/98#issuecomment-233189370","issue_url":"https://api.github.com/repos/sepulworld/aptly_cli/issues/98","id":233189370,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2016-07-17T16:07:42Z","updated_at":"2016-07-17T16:07:42Z","body":"\n[![Coverage Status](https://coveralls.io/builds/7041137/badge)](https://coveralls.io/builds/7041137)\n\nCoverage decreased (-0.4%) to 92.049% when pulling **a1bfbb04ebb0df2e148134df0766927594306301 on msabramo:password_ask** into **8161830f6041138d00b69a06727f5ad011eac00d on sepulworld:master**.\n"}}
{"actor":{"display_login":"coveralls"}}