mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 04:37:00 +00:00
add --console program option to automatically spawn
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
1 parent
2fb43dd38d
commit
263e338088
3 files changed
+30
-4
No files matched your search
+5
-1
@@ -12,6 +12,10 @@ pub(crate) struct Args {
|
||||
#[arg(short, long)]
|
||||
/// Optional argument to the path of a conduwuit config TOML file
|
||||
pub(crate) config: Option<PathBuf>,
|
||||
|
||||
/// Activate admin command console automatically after startup.
|
||||
#[arg(long, num_args(0))]
|
||||
pub(crate) console: bool,
|
||||
}
|
||||
|
||||
/// Parse commandline arguments into structured data
|
||||
@@ -22,7 +26,7 @@ pub(super) fn parse() -> Args { Args::parse() }
|
||||
pub(crate) fn update(config: &mut Config, args: &Args) -> Result<()> {
|
||||
// Indicate the admin console should be spawned automatically if the
|
||||
// configuration file hasn't already.
|
||||
config.admin_console_automatic |= args.console.unwrap_or(false);
|
||||
config.admin_console_automatic |= args.console;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user