diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml new file mode 100644 index 0000000..8b6a65a --- /dev/null +++ b/.github/workflows/sanity.yml @@ -0,0 +1,26 @@ +name: Sanity + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + sanity: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Update pip + run: python3 -m pip install --upgrade pip + + - name: Install + run: python3 -m pip install . + + - name: Install in editable mode + run: python3 -m pip install -e . + + - name: Check help message + run: python3 -m chatdbg --help diff --git a/src/chatdbg/chatdbg.py b/src/chatdbg/chatdbg.py index 44a7457..0a2357d 100644 --- a/src/chatdbg/chatdbg.py +++ b/src/chatdbg/chatdbg.py @@ -52,14 +52,14 @@ def main(): opts, args = getopt.getopt(sys.argv[1:], "mhc:", ["help", "command="]) - if not args: - print(_usage) - sys.exit(2) - if any(opt in ["-h", "--help"] for opt, optarg in opts): print(_usage) sys.exit() + if not args: + print(_usage) + sys.exit(2) + commands = [optarg for opt, optarg in opts if opt in ["-c", "--command"]] module_indicated = any(opt in ["-m"] for opt, optarg in opts)