Skip to main content

ToolCommand

Enum ToolCommand 

Source
pub enum ToolCommand {
    Install {
        package: String,
        php: Option<String>,
        with: Vec<String>,
        force: bool,
    },
    Uninstall {
        package: String,
    },
    Inject {
        package: String,
        with: Vec<String>,
    },
    Uninject {
        package: String,
        with: Vec<String>,
    },
    List,
    Dir {
        package: Option<String>,
    },
    Run(ToolRunArgs),
    Bgx(BgxArgs),
    Upgrade {
        package: Option<String>,
        all: bool,
        reinstall: bool,
    },
}

Variants§

§

Install

Install a tool. Pass <vendor>/<name> optionally followed by @<constraint> (e.g. phpstan/phpstan@^1.10).

Fields

§package: String

Composer package identifier, optionally with @<constraint>.

§php: Option<String>

Pin the tool to a specific PHP. Accepts a version (8.3, 8.3.12) or a constraint (~8.3, >=8.2,<8.4). When the requested PHP isn’t installed, bougie installs it automatically. Defaults to the highest installed NTS PHP.

§with: Vec<String>

Additional Composer package (vendor/name[@<constraint>]) or PHP extension (intl, redis) to install alongside the tool. May be passed multiple times.

§force: bool

Overwrite an existing executable at the bin-dir path.

§

Uninstall

Remove an installed tool by its <vendor>/<name> identifier.

Fields

§package: String

Composer package identifier.

§

Inject

Add an extra composer package or PHP extension to an installed tool. Re-resolves the tool’s lock and updates the vendor tree in place.

Fields

§package: String

Composer package identifier of the tool.

§with: Vec<String>

Extra to add (vendor/name[@<constraint>] for composer packages, bare name for PHP extensions). Repeatable.

§

Uninject

Remove an extra previously added via --with / inject.

Fields

§package: String

Composer package identifier of the tool.

§with: Vec<String>

Extra to remove. Repeatable.

§

List

List installed tools.

§

Dir

Print a tool’s install directory, or the tools root if no package is given.

Fields

§package: Option<String>

Composer package identifier; omit to print the tools root.

§

Run(ToolRunArgs)

Run an installed-or-cached tool one-off. Reuses an existing persistent install if (package, constraint, php, with) match exactly; otherwise materialises into the ephemeral cache.

bgx is provided as a convenient alias for bougie tool run; their behavior is identical.

§

Bgx(BgxArgs)

§

Upgrade

Re-resolve a tool’s lock and bring its vendor tree up to date. Pass --all to walk every installed tool, or --reinstall to wipe and rebuild from scratch (recovery for broken state).

Fields

§package: Option<String>

Composer package identifier. Required unless --all.

§all: bool

Upgrade every installed tool.

§reinstall: bool

Wipe the tool dir + every entrypoint symlink and reinstall from scratch using the receipt’s pinned (package, constraint, php_version, with, extensions) tuple.

Trait Implementations§

Source§

impl Debug for ToolCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for ToolCommand

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for ToolCommand

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.