Skip to content

Add config for easier command line usage#2

Merged
lokijuhy merged 3 commits into
masterfrom
config
Apr 19, 2021
Merged

Add config for easier command line usage#2
lokijuhy merged 3 commits into
masterfrom
config

Conversation

@lokijuhy
Copy link
Copy Markdown
Owner

@lokijuhy lokijuhy commented Apr 7, 2021

You can now run:
code_sync --register <project> # prompts for configuration and saves to config file
code_sync <project>

code_sync --list # lists registered projects

You can also still run code_sync the old way, specifying the local_dir, remote_dir, etc manually.

@lokijuhy lokijuhy requested review from matteobe and togop April 7, 2021 20:12
togop
togop previously approved these changes Apr 8, 2021
Comment thread code_sync/code_sync.py
parser.add_argument('--remote_dir', help='the remote directory you want to sync', required=True)
parser.add_argument('--target', help='specify which remote machine to connect to', required=True)
parser.add_argument('project', nargs='?', default=None)
parser.add_argument('--register', help='Register a new project to code_sync', required=False)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could add at parser.add_argument('--register': , action='store_true' and in this way, the check could be just if args.register

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I did it the way I have it is so that you call code_sync -- register <project name> and that starts registering the <project name> project. Do you think it is a better interface to instead to code_sync --register and then code_sync asks for the name of the project?

Comment thread code_sync/code_sync.py
Comment thread setup.py
Comment thread code_sync/code_sync.py Outdated
Comment thread code_sync/code_sync.py
Comment thread code_sync/code_sync.py
Comment thread code_sync/code_sync.py Outdated
Comment thread code_sync/code_sync.py Outdated
@lokijuhy
Copy link
Copy Markdown
Owner Author

Hi @togop- Would you like to respond to my replies to your comments, or should I go ahead and merge this as is?

@lokijuhy lokijuhy merged commit b095e78 into master Apr 19, 2021
@lokijuhy lokijuhy deleted the config branch April 19, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants