From 10b989f84b331a6cba39040cc5c35952e135adc9 Mon Sep 17 00:00:00 2001 From: Jan Allersma Date: Jan 26 2019 19:11:13 +0000 Subject: Update README.md * Add License. * Remove example. * Use `help` as argument to show the help message. --- diff --git a/Cargo.toml b/Cargo.toml index ef6b9ac..53ed450 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ambassade" -version = "0.1.0" +version = "1.0.0" authors = ["Jan Allersma "] [dependencies] diff --git a/README.md b/README.md index e1dd235..48ad3ec 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,42 @@ # Ambassade -## Notes +## What is Ambassade? -`backend::fetch::update_module()` kan wellicht met `backend::add::update_module()` samengevoegd worden. +In short, Ambassade is an agnostic package manager. This means that Ambassade +excels at managing projects that are cross OS and/or cross language. + +## Why Ambassade? + +A lot of non-trivial projects require (technical) documentation. These +projects are usually too complex to understand at first glance and require +more than just one command to build. Most organizations have rules about how +documentation should be provided and in what format, as it makes clear how the +project's software works and how to use it. Ambassade tries to simplify this. +Just one `build` and one `run` command should suffice to build and run software. +Developers shouldn't have to know how every part of the software that they do +not directly use, works. + +So Ambassade tries to solve an organizational problem: instead of having to +describe in the documentation how you as developer need to set up an ecosystem +that is required to successfully build and run your software, you just use +Ambassade to do it for you. This saves time, effort and frustration. + +## How to use Ambassade? + +The `ambassade help` command is enough to teach you the basics. For more +advanced usage of Ambassade, you will have to edit the config files. + +## Getting Ambassade + +### Building from source + +Use Cargo to build Ambassade from source: + +```bash +cargo build # For debug version +cargo build --release # For release version +``` + +## Licence + +See the [`LICENSE`](https://pagure.io/Ambassade/raw/master/f/doc/LICENSE) document for Ambassade's license. diff --git a/doc/LICENSE b/doc/LICENSE new file mode 100644 index 0000000..3348eb6 --- /dev/null +++ b/doc/LICENSE @@ -0,0 +1,7 @@ +Copyright 2019 J.D. Allersma + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/example/commands.sh b/example/commands.sh deleted file mode 100644 index 92ef75f..0000000 --- a/example/commands.sh +++ /dev/null @@ -1,45 +0,0 @@ -# Voorbereiding -cargo build # in ambassade dir. -sudo cp -v ./target/debug/ambassade /usr/local/bin/ambassade -sudo npm i --global http-server - -# Initializatie: -git init example -ambassade init - -# Een 'module' ergens vandaan halen zonder een config file in de module zelf aan te maken: -ambassade hide elasticsearch-6.5.4 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.4.tar.gz - -# Modules toevoegen die al een config file hebben: -ambassade add Ambassade-example-login-stats git clone https://pagure.io/Ambassade-example-login-stats - -# NPM packages werken nog niet zo lekker: -ambassade add Ambassade-example-login-user git clone https://pagure.io/Ambassade-example-login-user -pushd ./dep/Ambassade-example-login-user -npm i -popd - -# Hide past het 'add' behavior aan: -ambassade hide requests git clone git://github.com/requests/requests.git --depth=1 - -# Bouw het project: -ambassade build -# Build command voor requests: pip install ./dep/requests --user -# Build command voor elasticsearch: tar -xvzf ./dep/elasticsearch-6.5.4.tar.gz -C ./dep -# Build command voor example: echo no build command - -# Set run command for elasticsearch: -ambassade run elasticsearch-6.5.4 - -# Verander commando voor Windows: -nano ./dep_config/elasticsearch-6.5.4 - -# Run het project: -ambassade run elasticsearch-6.5.4 Ambassade-example-login-user - - -# Open browser zonder CORS: -about:config -> security.fileuri.strict_origin_policy -> false. # en daarna weer reverten ofc. - -# Run het beheersysteem: -ambassade run Ambassade-example-login-stats diff --git a/example/dep_config/elasticsearch-6.5.4.json b/example/dep_config/elasticsearch-6.5.4.json deleted file mode 100644 index dc4e71d..0000000 --- a/example/dep_config/elasticsearch-6.5.4.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "build": { - "linux": "tar -xvzf ./dep/elasticsearch-6.5.4.tar.gz -C ./dep", - "os-x": "tar -xvzf ./dep/elasticsearch-6.5.4.tar.gz -C ./dep", - "windows": "tar -xvzf ./dep/elasticsearch-6.5.4.tar.gz -C ./dep" - }, - "run": { - "linux": "./bin/elasticsearch", - "os-x": "./bin/elasticsearch", - "windows": "./bin/elasticsearch" - } -} \ No newline at end of file diff --git a/example/dep_config/requests.json b/example/dep_config/requests.json deleted file mode 100644 index 6feb895..0000000 --- a/example/dep_config/requests.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "build": { - "linux": "pip install ./dep/requests --user", - "os-x": "pip install ./dep/requests --user", - "windows": "pip install ./dep/requests --user" - }, - "run": { - "linux": "", - "os-x": "", - "windows": "" - } -} diff --git a/src/backend/project.rs b/src/backend/project.rs index ae6853d..5faa308 100644 --- a/src/backend/project.rs +++ b/src/backend/project.rs @@ -174,9 +174,7 @@ pub fn help() { println!("$ ambassade [FLAG] [COMMAND [ARGUMENTS]]"); println!(""); - println!("--help -h\t\t\t\tShow this message"); - println!(""); - + println!("help\t\t\t\tShow this message"); println!("init [DIRECTORY]\t\t Initialize new project in specified directory. Defaults to current directory."); println!("build [--module]\t\t Build current project if module flag is not specified, otherwise only the module will be built."); println!("run [MODULES]\t\t\t Build current project and run MODULES. MODULES default to the project module."); diff --git a/src/parser.rs b/src/parser.rs index e73755b..538bf18 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -18,7 +18,7 @@ pub fn parse_command<'a, I>(args: &mut I) -> bool where I: Iterator(args: &mut I, open_shell: bool) -> bool where I: Iterator { match args.next() { Some(argument) => { - if argument == "--help" || argument == "-h" { + if argument == "--help" || argument == "-h" || argument == "help" { backend::project::help(); } else if argument == "init" {