import click
from sqltocpp import convert


@click.command()
@click.option('--sql', help='schema file name')
@click.option('--target', default='schema.hpp', help='hpp file name')
def execute(sql, target):
    convert.schema_to_struct(sql, target)



if __name__ == '__main__':
    try:
        execute()
    except:
        execute("--help")

import click
from sqltocpp import convert


@click.command()
@click.argument('sql_schema_file')
@click.option('--target', default='schema.hpp', help='hpp file name')
def execute(sql_schema_file, target):
    convert.schema_to_struct(sql_schema_file, target)



if __name__ == '__main__':
    execute()

Add click based commandline interface script
Add click based commandline interface script

sqltocpp is intended to be a CLI command.
This enables it to be so

  import click
  from sqltocpp import convert
  
  
  @click.command()
- @click.option('--sql', help='schema file name')
+ @click.argument('sql_schema_file')
  @click.option('--target', default='schema.hpp', help='hpp file name')
- def execute(sql, target):
+ def execute(sql_schema_file, target):
-     convert.schema_to_struct(sql, target)
+     convert.schema_to_struct(sql_schema_file, target)
  
  
  
  if __name__ == '__main__':
-     try:
-         execute()
+     execute()
-     except:
-         execute("--help")
  
Add click based commandline interface script
## Code Before:
import click
from sqltocpp import convert


@click.command()
@click.option('--sql', help='schema file name')
@click.option('--target', default='schema.hpp', help='hpp file name')
def execute(sql, target):
    convert.schema_to_struct(sql, target)



if __name__ == '__main__':
    try:
        execute()
    except:
        execute("--help")

## Instruction:
Add click based commandline interface script
## Code After:
import click
from sqltocpp import convert


@click.command()
@click.argument('sql_schema_file')
@click.option('--target', default='schema.hpp', help='hpp file name')
def execute(sql_schema_file, target):
    convert.schema_to_struct(sql_schema_file, target)



if __name__ == '__main__':
    execute()
