dcmoura / spyql

Query data on the command line with SQL-like SELECTs powered by Python expressions
https://spyql.readthedocs.io
MIT License
918 stars 25 forks source link

Command line argument parsing #33

Closed dcmoura closed 3 years ago

dcmoura commented 3 years ago

Added basic command line arguments and help:

Usage: spyql.py [OPTIONS] QUERY

  Tool to run a SpyQL QUERY over text data. For more info visit:
  https://github.com/dcmoura/spyql

  SELECT
      [ * | python_expression [ AS output_column_name ] [, ...] ]
      [ FROM csv | spy | text | python_expression | json [ EXPLODE path ] ]
      [ WHERE python_expression ]
      [ LIMIT row_count ]
      [ OFFSET num_rows_to_skip ]
      [ TO csv | json | text | spy | sql | pretty | plot ]

Options:
  -v, --verbose INTEGER  Set verbose level: -2 to supress errors and warnings;
                         -1 to supress warnings; 0 to only show errors and
                         warnings (default); 1 to show additional info
                         messages; 2 to show additional debug messages.

  -W [default|error]     Set if warnings are turned into errors or if warnings
                         do not halt execution (default).

  --version              Show the version and exit.
  --help                 Show this message and exit.

Closes issue #21 .