Add multiple arguments support, improve list table #11

Merged
mdaleo404 merged 1 commits from some-improvements into main 2026-06-23 13:33:54 +00:00
Owner

Patch sent by

mig5 ( website | Forgejo )

Now the user can run

chguard 700 foo1 foo2

Without getting

Traceback (most recent call last):
  File "/usr/bin/chguard", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3/dist-packages/chguard/cli.py", line 291, in main
    conn.execute(
    ~~~~~~~~~~~~^
        """
        ^^^
    ...<11 lines>...
        ),
        ^^
    )
    ^
sqlite3.IntegrityError: UNIQUE constraint failed: entries.state_id, entries.path

It also changes the --list table, by adding another column, because there might be multiple files in the same 'snapshot' row in the database with this fix.
Something like:

  State                  Snapshot root               Captured paths   Created                   
 ────────────────────────────────────────────────────────────────────────────────────────────────
  test new feature       /home/user-test/test/file   file             2026-06-23T13:06:30+00:00 

### Patch sent by **mig5** ( [website](https://www.mig5.net/) | [Forgejo](https://git.mig5.net/) ) Now the user can run ``` chguard 700 foo1 foo2 ``` Without getting ``` Traceback (most recent call last): File "/usr/bin/chguard", line 8, in <module> sys.exit(main()) ~~~~^^ File "/usr/lib/python3/dist-packages/chguard/cli.py", line 291, in main conn.execute( ~~~~~~~~~~~~^ """ ^^^ ...<11 lines>... ), ^^ ) ^ sqlite3.IntegrityError: UNIQUE constraint failed: entries.state_id, entries.path ``` It also changes the `--list` table, by adding another column, because there might be multiple files in the same 'snapshot' row in the database with this fix. Something like: ``` State Snapshot root Captured paths Created ──────────────────────────────────────────────────────────────────────────────────────────────── test new feature /home/user-test/test/file file 2026-06-23T13:06:30+00:00 ```
mdaleo404 added 1 commit 2026-06-23 13:22:40 +00:00
Add multiple arguments support, improve list table
Lint & Security / precommit-and-security (pull_request) Successful in 2m4s
9f7bc804b0
mdaleo404 merged commit 0f5a80e67c into main 2026-06-23 13:33:54 +00:00
mdaleo404 deleted branch some-improvements 2026-06-23 13:33:55 +00:00
Sign in to join this conversation.