Your ROOT_URL in app.ini is https://git.ondrovo.com/ but you are visiting http://159.69.29.240:49153/packages/cli-app-base/commit/09fcbc4d9870df84a0d6e5b2a584485494b866b9?style=unified&whitespace=ignore-change
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
10 additions and
5 deletions
Cargo.toml
examples/minimal.rs
examples/rotn.rs
src/lib.rs
@ -1,6 +1,6 @@
[ package ]
name = "clappconfig"
version = "0.3.1 "
version = "0.4.0 "
authors = [ "Ondřej Hruška <ondra@ondrovo.com>" ]
edition = "2018"
license = "MIT"
@ -30,7 +30,11 @@ impl AppConfig for Config {
}
fn main ( ) -> anyhow ::Result < ( ) > {
let cfg = Config ::init ( "Foo Example" , "examples/foo.json" , None ) ? ;
let cfg = Config ::init (
"Foo Example" ,
"examples/foo.json" ,
env! ( "CARGO_PKG_VERSION" ) ,
) ? ;
trace ! ( "Trace message" ) ;
debug ! ( "Debug message" ) ;
@ -149,7 +149,7 @@ fn main() -> anyhow::Result<()> {
env! ( "CARGO_PKG_AUTHORS" )
) ;
let main = Config ::init ( "Rot-N" , "rotn_config.json" , Some ( & version ) ) ? ;
let main = Config ::init ( "Rot-N" , "rotn_config.json" , & version ) ? ;
// rot13
@ -62,8 +62,9 @@ pub trait AppConfig: Sized + Serialize + DeserializeOwned + Debug + Default {
fn configure < ' a > ( self , _clap : & clap ::ArgMatches < ' a > ) -> anyhow ::Result < Self ::Init > ;
/// Initialize the app
fn init ( name : & str , cfg_file_name : & str , version : Option < & str > ) -> anyhow ::Result < Self ::Init > {
let version = version . unwrap_or_else ( | | env! ( "CARGO_PKG_VERSION" ) ) ;
///
/// Use `env!("CARGO_PKG_VERSION")` to get a version string from Cargo.toml
fn init ( name : & str , cfg_file_name : & str , version : & str ) -> anyhow ::Result < Self ::Init > {
let clap = clap ::App ::new ( name )
. arg (
clap ::Arg ::with_name ( "config" )