Build and Install Tools
You can use various way to build and install your CLI, this includes:
- use it as a script, and enable or disable compile cache via (
Comonicon.disable_cache
andComonicon.enable_cache
). - build it as a package and install to
~/.julia/bin
:- use
compile=:min
inComonicon.install
if you don't care about the speed - use
sysimg=true
inComonicon.install
if you care about both start up time and the speed
- use
Reference
Comonicon.PATH
— Modulepath related functions.
Comonicon.PATH.default_exename
— Methoddefault_exename()
Default Julia executable name: joinpath(Sys.BINDIR, Base.julia_exename())
Comonicon.PATH.default_julia_bin
— Methoddefault_julia_bin()
Return the default path to .julia/bin
.
Comonicon.PATH.default_julia_fpath
— Methoddefault_julia_fpath()
Return the default path to .julia/completions
Comonicon.PATH.default_name
— Methoddefault_name(x)
Return the lowercase of nameof(x)
in String
.
Comonicon.PATH.default_name
— Methoddefault_name(x)
Return the lowercase of a given package name. It will ignore the suffix if it ends with ".jl".
Base.write
— Methodwrite([io], cmd::EntryCommand)
Write the generated CLI script into a Julia script file. Default is the cachefile
.
Comonicon.BuildTools.cmd_script
— Methodcmd_script(mod, shadow; kwargs...)
Generates a shell script that can be use as the entry of mod.command_main
.
Arguments
mod
: a module that contains the commands and the entry.shadow
: location of a Julia script that calls the actualmod.command_main
.
Keywords
exename
: The julia executable name, default isPATH.default_exename
.sysimg
: System image to use, default isnothing
.project
: the project path of the CLI.compile
: julia compile level, can be [:yes, :no, :all, :min]optimize
: julia optimization level, default is 2.
Comonicon.BuildTools.detect_shell
— Methoddetect_shell()
Detect shell type via SHELL
environment variable.
Comonicon.BuildTools.install_script
— Methodinstall a script as the CLI
Comonicon.BuildTools.osname
— Methodosname()
Return the name of OS, will be used in building tarball.
Comonicon.BuildTools.write_path
— Functionwrite_path(rcfile[, yes=false])
Write PATH
and FPATH
to current shell's rc files (.zshrc, .bashrc) if they do not exists.