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 #52 from constellation-rs/docopt-fix
Fix docopt syntax
- Loading branch information
Showing
15 changed files
with
125 additions
and
36 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
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
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
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
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,84 @@ | ||
//= { | ||
//= "output": { | ||
//= "2": [ | ||
//= "", | ||
//= true | ||
//= ], | ||
//= "1": [ | ||
//= "", | ||
//= true | ||
//= ] | ||
//= }, | ||
//= "children": [ | ||
//= { | ||
//= "output": { | ||
//= "2": [ | ||
//= "", | ||
//= true | ||
//= ], | ||
//= "1": [ | ||
//= "", | ||
//= true | ||
//= ] | ||
//= }, | ||
//= "children": [], | ||
//= "exit": "Success" | ||
//= }, | ||
//= { | ||
//= "output": { | ||
//= "2": [ | ||
//= "", | ||
//= true | ||
//= ], | ||
//= "1": [ | ||
//= "", | ||
//= true | ||
//= ] | ||
//= }, | ||
//= "children": [], | ||
//= "exit": "Success" | ||
//= } | ||
//= ], | ||
//= "exit": "Success" | ||
//= } | ||
|
||
#![allow(clippy::unused_unit)] // for FnOnce! | ||
|
||
use constellation::*; | ||
use serde_closure::FnOnce; | ||
use std::env; | ||
|
||
fn main() { | ||
init(Resources { | ||
mem: 20 * 1024 * 1024, | ||
..Resources::default() | ||
}); | ||
let env = ( | ||
env::args().collect::<Vec<_>>(), | ||
env::vars() | ||
.filter(|&(ref key, _)| key != "CONSTELLATION" && key != "CONSTELLATION_RESOURCES") | ||
.collect::<Vec<_>>(), | ||
); | ||
for _ in 0..2 { | ||
let env = env.clone(); | ||
let _pid = spawn( | ||
Resources { | ||
mem: 20 * 1024 * 1024, | ||
..Resources::default() | ||
}, | ||
FnOnce!(|_parent| { | ||
let env2 = ( | ||
env::args().collect::<Vec<_>>(), | ||
env::vars() | ||
.filter(|&(ref key, _)| { | ||
key != "CONSTELLATION" && key != "CONSTELLATION_RESOURCES" | ||
}) | ||
.collect::<Vec<_>>(), | ||
); | ||
assert_eq!(env, env2); | ||
}), | ||
) | ||
.block() | ||
.expect("spawn() failed to allocate process"); | ||
} | ||
} |
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