forked from Kuska-ssb/solar
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from mycognosist/split_cli
Split CLI and application config from main
- Loading branch information
Showing
5 changed files
with
383 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use std::path::PathBuf; | ||
|
||
use structopt::StructOpt; | ||
|
||
/// Generate a command line parser. | ||
/// This defines the options that are exposed when running the solar binary. | ||
#[derive(StructOpt, Debug)] | ||
#[structopt(name = "🌞 Solar", about = "Sunbathing scuttlecrabs in kuskaland", version=env!("SOLAR_VERSION"))] | ||
pub struct Cli { | ||
/// Where data is stored (default: ~/.local/share/local) | ||
#[structopt(short, long, parse(from_os_str))] | ||
pub data: Option<PathBuf>, | ||
|
||
/// Connect to peers (e.g. host:port:publickey, host:port:publickey) | ||
#[structopt(short, long)] | ||
pub connect: Option<String>, | ||
|
||
// TODO: think about other ways of exposing the "connect" feature | ||
/// List of peers to replicate; "connect" magic word means that peers | ||
/// specified with --connect are added to the replication list | ||
#[structopt(short, long)] | ||
pub replicate: Option<String>, | ||
|
||
/// Port to bind (default: 8008) | ||
#[structopt(short, long)] | ||
pub port: Option<u16>, | ||
|
||
/// Run LAN discovery (default: false) | ||
#[structopt(short, long)] | ||
pub lan: Option<bool>, | ||
|
||
/// Run the JSON-RPC server (default: true) | ||
#[structopt(short, long)] | ||
pub jsonrpc: Option<bool>, | ||
|
||
/// Resync the local database by requesting the local feed from peers | ||
#[structopt(long)] | ||
pub resync: Option<bool>, | ||
} |
Oops, something went wrong.