https://bugzilla.wikimedia.org/show_bug.cgi?id=65827

--- Comment #3 from Antoine "hashar" Musso <[email protected]> ---
argparse supports sub commands
https://docs.python.org/2.7/library/argparse.html#sub-commands


Before writing any code, we might want to list out the tree of possible
commands. Bryan stated a few use case in the first comment:

 $ scap scap "deploying something"  # or `scap sync`? 
 $ scap sync-dblist
 $ scap sync-dir some_dir "syncing a dir"
 $ scap sync-docroot
 $ scap sync-file some_file "syncing a file"
 $ scap sync-wikiversions
 $ scap sync-common
 $ scap update-l10n
 $ scap ...

I would go with something like:


 scap sync --all
 # and an alias:
 scap all

 scap sync dblist
 scap sync dir /some_dir
 scap sync file /some_file

 scap update l10n

And so on...


By using entry points, you can map a chain of sub commands to a methods to be
invoked which ease the mapping.
http://pythonhosted.org/setuptools/pkg_resources.html#entry-points but that
might be overkill.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to