From 134d48399ac537d4841575ee0363a309a3461e23 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Thu, 8 Mar 2018 18:07:01 +0100 Subject: Initial commit --- LICENSE | 21 +++++++++++++++++++++ bibtool/__init__.py | 0 bibtool/__main__.py | 6 ++++++ bibtool/cli.py | 20 ++++++++++++++++++++ requirements.txt | 1 + 5 files changed, 48 insertions(+) create mode 100644 LICENSE create mode 100644 bibtool/__init__.py create mode 100644 bibtool/__main__.py create mode 100644 bibtool/cli.py create mode 100644 requirements.txt diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1a3601d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Robin Krahl + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/bibtool/__init__.py b/bibtool/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bibtool/__main__.py b/bibtool/__main__.py new file mode 100644 index 0000000..59af02f --- /dev/null +++ b/bibtool/__main__.py @@ -0,0 +1,6 @@ +# Copyright (C) 2018 Robin Krahl +# SPDX-License-Identifier: MIT + +import bibtool.cli + +bibtool.cli.cli() diff --git a/bibtool/cli.py b/bibtool/cli.py new file mode 100644 index 0000000..23ceaa4 --- /dev/null +++ b/bibtool/cli.py @@ -0,0 +1,20 @@ +# Copyright (C) 2018 Robin Krahl +# SPDX-License-Identifier: MIT + +import click + + +TYPE_FILE = click.Path(exists=True, file_okay=True, dir_okay=False) +TYPE_DIR = click.Path(exists=True, file_okay=False, dir_okay=True) + + +@click.group() +def cli(): + pass + + +@cli.command('import') +@click.argument('filename', type=TYPE_FILE) +@click.option('--directory', type=TYPE_DIR) +def _import(filename, directory): + click.echo(filename) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..dca9a90 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +click -- cgit v1.2.1