python - Fabfiles With Command Line Arguments -


Is your fabfile command line a clear way of moving logic? I am writing an installation script for a device that I want to be able to specify an alternate target directory through the command line.

I have written some code to write what will happen if I have some command line arguments:

  # fabfile.py Importing SYS def installation (): _get_options () def _get_options (): Print repr (sys.argv [1:])  

Runs:

  $ fab installed ['installs'] Finished $ Fab Installed - Electric-Booglu Usage: Fab [Options] & lt; Command & gt; [: Arg1, arg2 = val2, host = foo, host = 'h1; H2 ', ...] ... Fab: Error: No options like: --ElectricBoogle  

I ended up using per-action arguments. It seems like a better idea than the exceptioned command line arguments.


Comments