Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow options anywhere #1332

Open
WilliamDEdwards opened this issue Aug 23, 2024 · 0 comments
Open

Allow options anywhere #1332

WilliamDEdwards opened this issue Aug 23, 2024 · 0 comments
Labels

Comments

@WilliamDEdwards
Copy link

Deleted package with -dry-run:

aptly@aptly:~$ aptly repo remove common 'python3-cyberfusion-aptly-apicli (= 1.0.2.2)' -dry-run
Loading packages...
[-] python3-cyberfusion-aptly-apicli_1.0.2.2_all removed

... but it was actually removed, as you can see from the fact that the real run didn't delete anything:

aptly@aptly:~$ aptly repo remove common 'python3-cyberfusion-aptly-apicli (= 1.0.2.2)'
Loading packages...

This is PEBKAC. The option should be before the command:

aptly@aptly:~$ aptly repo remove -dry-run common 'python3-cyberfusion-aptly-apicli (= 1.0.2.2.1)'
Loading packages...
[-] python3-cyberfusion-aptly-apicli_1.0.2.2.1_all removed

Changes not saved, as dry run has been requested.

Even though I should have read the documentation first, to prevent mistakes like this, it might be good to accept options anywhere - as many CLIs do.

Also, where options should be is not explained in Aptly's help text:

aptly@aptly:~$ aptly -h
aptly - Debian repository management tool

Commands:

    api         start API server/issue requests
    config      manage aptly configuration
    db          manage aptly's internal database and package pool
    graph       render graph of relationships
    mirror      manage mirrors of remote repositories
    package     operations on packages
    publish     manage published repositories
    repo        manage local package repositories
    serve       HTTP serve published repositories
    snapshot    manage snapshots of repositories
    task        manage aptly tasks
    version     display version

Use "aptly help <command>" for more information about a command.


Options:
  -architectures="": list of architectures to consider during (comma-separated), default to all available
  -config="": location of configuration file (default locations are /etc/aptly.conf, ~/.aptly.conf)
  -db-open-attempts=10: number of attempts to open DB if it's locked by other instance
  -dep-follow-all-variants: when processing dependencies, follow a & b if dependency is 'a|b'
  -dep-follow-recommends: when processing dependencies, follow Recommends
  -dep-follow-source: when processing dependencies, follow from binary to Source packages
  -dep-follow-suggests: when processing dependencies, follow Suggests
  -dep-verbose-resolve: when processing dependencies, print detailed logs
  -gpg-provider="": PGP implementation ("gpg", "gpg1", "gpg2" for external gpg or "internal" for Go internal implementation)
ERROR: unable to parse flags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants