aptly icon indicating copy to clipboard operation
aptly copied to clipboard

Allow options anywhere

Open WilliamDEdwards opened this issue 1 year ago • 0 comments

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

WilliamDEdwards avatar Aug 23 '24 08:08 WilliamDEdwards