summaryrefslogtreecommitdiff
path: root/gerbonara/__main__.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-02-25 17:31:16 +0100
committerjaseg <git@jaseg.de>2023-02-25 17:31:16 +0100
commit8b40d15dab376c92b37b0939515e7bdee7b83301 (patch)
tree1a9b1d513300cf17109d19d16e95fbb0e0a7e99f /gerbonara/__main__.py
parentd43eff8b49022719b2933e8429a05e3a35b8762f (diff)
downloadgerbonara-8b40d15dab376c92b37b0939515e7bdee7b83301.tar.gz
gerbonara-8b40d15dab376c92b37b0939515e7bdee7b83301.tar.bz2
gerbonara-8b40d15dab376c92b37b0939515e7bdee7b83301.zip
Moar doc
Diffstat (limited to 'gerbonara/__main__.py')
-rw-r--r--gerbonara/__main__.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/gerbonara/__main__.py b/gerbonara/__main__.py
index 57b3737..69c55fb 100644
--- a/gerbonara/__main__.py
+++ b/gerbonara/__main__.py
@@ -2,24 +2,8 @@
import click
-from .layers import LayerStack
-
-
-@click.command()
-@click.option('-t' ,'--top', help='Render board top side.', is_flag=True)
-@click.option('-b' ,'--bottom', help='Render board bottom side.', is_flag=True)
-@click.argument('gerber_dir_or_zip', type=click.Path(exists=True))
-@click.argument('output_svg', required=False, default='-', type=click.File('w'))
-def render(gerber_dir_or_zip, output_svg, top, bottom):
- if (bool(top) + bool(bottom)) != 1:
- raise click.UsageError('Excactly one of --top or --bottom must be given.')
-
- stack = LayerStack.open(gerber_dir_or_zip, lazy=True)
- print(f'Loaded {stack}')
-
- svg = stack.to_pretty_svg(side=('top' if top else 'bottom'))
- output_svg.write(str(svg))
+from .cli import cli
if __name__ == '__main__':
- render()
+ cli()