add sub-crate

This commit is contained in:
Brian Grinstead 2016-12-16 12:51:04 -08:00
parent f7c97e776c
commit a22b43e1aa
5 changed files with 41 additions and 1 deletions

2
.gitignore vendored
View file

@ -18,7 +18,7 @@ Cargo.lock
/classes/ /classes/
/node_modules/ /node_modules/
/out/ /out/
/target/ target/
pom.xml pom.xml
pom.xml.asc pom.xml.asc
/.cljs_node_repl/ /.cljs_node_repl/

7
cli/Cargo.toml Normal file
View file

@ -0,0 +1,7 @@
[package]
name = "datomish-cli"
version = "0.0.1"
[dependencies]
[dependencies.datomish]
path = "../"

8
cli/README.md Normal file
View file

@ -0,0 +1,8 @@
# datomish-cli
Note: this isn't actually doing anything and is just a placeholder to get the project structure in place. To run it locally, use:
````
cd cli
cargo run
````

20
cli/src/main.rs Normal file
View file

@ -0,0 +1,20 @@
// Copyright 2016 Mozilla
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
use std::env;
extern crate datomish;
// This is just a placeholder to get the project structure in place.
fn main() {
println!("Loaded {}", datomish::get_name());
let args: Vec<String> = env::args().collect();
println!("I got {:?} arguments: {:?}.", args.len() - 1, &args[1..]);
}

View file

@ -8,6 +8,11 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the // CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License. // specific language governing permissions and limitations under the License.
pub fn get_name() -> String {
return String::from("datomish");
}
pub fn add_two(a: i32) -> i32 { pub fn add_two(a: i32) -> i32 {
a + 2 a + 2
} }