Enum Commands

Source
pub enum Commands {
Show 33 variants Add(Add), Build(Build), Config(ConfigCmd), Completion(Completion), Debug(Debug), Doc(Doc), Download(Download), Fmt(Fmt), GenerateRockspec(GenerateRockspec), Info(Info), Install(Install), InstallRockspec(InstallRockspec), InstallLua, Lint(Lint), List(ListCmd), Lua(RunLua), New(NewProject), Outdated(Outdated), Pack(Pack), Path(Path), Pin(ChangePin), Purge, Remove(Remove), Run(Run), Exec(Exec), Search(Search), Test(Test), Uninstall(Uninstall), Unpin(ChangePin), Update(Update), Upload(Upload), Which(Which), Shell(Shell),
}

Variants§

§

Add(Add)

Add a dependency to the current project.

§

Build(Build)

Build/compile a project.

§

Config(ConfigCmd)

Interact with the lux configuration.

§

Completion(Completion)

Generate autocompletion scripts for the shell.{n} Example: lx completion zsh > ~/.zsh/completions/_lx

§

Debug(Debug)

Internal commands for debugging Lux itself.

§

Doc(Doc)

Show documentation for an installed rock.

§

Download(Download)

Download a specific rock file from a luarocks server.

§

Fmt(Fmt)

Formats the codebase with stylua.

§

GenerateRockspec(GenerateRockspec)

Generate a rockspec file from a project.

§

Info(Info)

Show metadata for any rock.

§

Install(Install)

Install a rock for use on the system.

§

InstallRockspec(InstallRockspec)

Install a local rockspec for use on the system.

§

InstallLua

Manually install and manage Lua headers for various Lua versions.

§

Lint(Lint)

Lints the current project using luacheck.

§

List(ListCmd)

List currently installed rocks.

§

Lua(RunLua)

Run lua, with the LUA_PATH and LUA_CPATH set to the specified lux tree.

§

New(NewProject)

Create a new Lua project.

§

Outdated(Outdated)

List outdated rocks.

§

Pack(Pack)

Create a packed rock for distribution, packing sources or binaries.

§

Path(Path)

Return the currently configured package path.

§

Pin(ChangePin)

Pin an existing rock, preventing any updates to the package.

§

Purge

Remove all installed rocks from a tree.

§

Remove(Remove)

Remove a rock from the current project’s lux.toml dependencies.

§

Run(Run)

Run the current project with the provided arguments.

§

Exec(Exec)

Execute a command that has been installed with lux. If the command is not found, a package named after the command will be installed.

§

Search(Search)

Query the luarocks servers.

§

Test(Test)

Run the test suite in the current project directory.{n} Lux supports the following test backends, specified by the [test] table in the lux.toml:{n} {n}

  • busted:{n} {n} https://lunarmodules.github.io/busted/{n} {n} Example:{n} {n}
    [test]{n}
    type = "busted"{n}
    flags = [ ] # Optional CLI flags to pass to busted{n}
    ```{n}
    {n}
    `lx test` will default to using `busted` if no test backend is specified and:{n}
        * there is a `.busted` file in the project root{n}
        * or `busted` is one of the `test_dependencies`).{n}

{n}

  • busted-nlua:{n}: {n} [currently broken on macOS and Windows] A build backend for running busted tests with Neovim as the Lua interpreter. Used for testing Neovim plugins. {n} Example:{n} {n}
    [test]{n}
    type = "busted-nlua"{n}
    flags = [ ] # Optional CLI flags to pass to busted{n}
    ```{n}
    {n}
    `lx test` will default to using `busted-nlua` if no test backend is specified and:{n}
        * there is a `.busted` file in the project root{n}
        * or `busted` and `nlua` are `test_dependencies`.{n}

{n}

  • command:{n} {n} Name/file name of a shell command that will run the test suite.{n} Example:{n} {n}
    [test]{n}
    type = "command"{n}
    command = "make"{n}
    flags = [ "test" ]{n}
    ```{n}
    {n}
  • script:{n} {n} Relative path to a Lua script that will run the test suite.{n} Example:{n} {n}
    [test]{n}
    type = "script"{n}
    script = "tests.lua" # Expects a tests.lua file in the project root{n}
    flags = [ ] # Optional arguments passed to the test script{n}
    ```{n}
§

Uninstall(Uninstall)

Uninstall a rock from the system.

§

Unpin(ChangePin)

Unpins an existing rock, allowing updates to alter the package.

§

Update(Update)

Updates all rocks in a project.

§

Upload(Upload)

Generate a Lua rockspec for a Lux project and upload it to the public luarocks repository.{n} You can specify a source template for release and dev packages in the lux.toml.{n} {n} Example:{n} {n}

[source]{n}
url = "https://host.com/owner/$(PACKAGE)/refs/tags/$(REF).zip"{n}
dev = "git+https://host.com/owner/$(PACKAGE).git"{n}
```{n}
{n}
You can use the following variables in the source template:{n}
{n}
 - $(PACKAGE): The package name.{n}
 - $(VERSION): The package version.{n}
 - $(REF): The git tag or revision (if in a git repository).{n}
 - You may also specify environment variables with `$(<VAR_NAME>)`.{n}
{n}
If the `version` is not set in the lux.toml, lux will search the current
commit for SemVer tags and if found, will use it to generate the package version.
§

Which(Which)

Tell which file corresponds to a given module name.

§

Shell(Shell)

Spawns an interactive shell with PATH, LUA_PATH, LUA_CPATH and LUA_INIT set.

Trait Implementations§

Source§

impl FromArgMatches for Commands

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 Commands

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<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
Source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

Source§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
Source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
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, Dst> ConvAsUtil<Dst> for T

Source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
Source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
Source§

impl<T> ConvUtil for T

Source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
Source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
Source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
Source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
Source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

Source§

type Proj<U: 'src> = U

Source§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<Src> TryFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
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<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
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.
Source§

impl<Src> ValueFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
Source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

Source§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSend for T