Extract application facts into module

This commit is contained in:
timvisee 2018-03-08 17:49:01 +01:00
parent ed4da6c2a1
commit 57d2e79400
No known key found for this signature in database
GPG key ID: 109CBA0BF74036C2
2 changed files with 23 additions and 10 deletions

11
src/app.rs Normal file
View file

@ -0,0 +1,11 @@
/// The application name.
pub const APP_NAME: &'static str = "ffsend";
/// The application version.
pub const APP_VERSION: &'static str = "0.1";
/// The application author.
pub const APP_AUTHOR: &'static str = "Tim Visee <timvisee@gmail.com>";
/// Application about information.
pub const APP_ABOUT: &'static str = "A simple Firefox Send CLI client.";

View file

@ -8,6 +8,7 @@ extern crate reqwest;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
mod app;
mod b64; mod b64;
mod crypto; mod crypto;
mod metadata; mod metadata;
@ -24,23 +25,24 @@ use reqwest::header::Authorization;
use reqwest::mime::APPLICATION_OCTET_STREAM; use reqwest::mime::APPLICATION_OCTET_STREAM;
use reqwest::multipart::Part; use reqwest::multipart::Part;
use app::*;
use crypto::{derive_auth_key, derive_file_key, derive_meta_key}; use crypto::{derive_auth_key, derive_file_key, derive_meta_key};
use metadata::{Metadata, XFileMetadata}; use metadata::{Metadata, XFileMetadata};
use reader::EncryptedFileReaderTagged; use reader::EncryptedFileReaderTagged;
fn main() { fn main() {
// Handle CLI arguments // Handle CLI arguments
let matches = App::new("ffsend") let matches = App::new(APP_NAME)
.version("0.1.0") .version(APP_VERSION)
.author("Tim Visee <timvisee@gmail.com>") .author(APP_AUTHOR)
.about("A simple Firefox Send CLI client") .about(APP_ABOUT)
.arg(Arg::with_name("file") .arg(Arg::with_name("file")
.short("f") .short("f")
.long("file") .long("file")
.value_name("PATH") .value_name("PATH")
.help("The file to upload") .help("The file to upload")
.required(true) .required(true)
.multiple(false)) .multiple(false))
.get_matches(); .get_matches();
// Get the path // Get the path