snapcraft options are position-dependent

Bug #1841892 reported by Michał Sawicz
54
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Snapcraft
Triaged
Medium
Sergio Schvezov

Bug Description

$ snapcraft --use-lxd build
Support for 'multipass' needs to be set up. Would you like to do that it now? [y/N]:

vs.

$ snapcraft build --use-lxd
Launching a container

Command line options being positional makes for a very confusing user experience. And if `--use-lxd` is an invalid option before the command, it should be a straight-up error instead of being ignored.

Michał Sawicz (saviq)
description: updated
Changed in snapcraft:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Sergio Schvezov (sergiusens)
Revision history for this message
John Neffenger (jgneff) wrote :

This issue prevents setting up a simple Bash alias that always uses LXD.

I would like to define the following alias:

~/.bash_aliases
---------------
alias snapcraft='snapcraft --use-lxd'

The workaround is to define a function with a different name that puts the option at the end of the command line, like this:

~/.bash_aliases
---------------
function sc() {
    snapcraft $@ --use-lxd
}

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.