Compare commits
No commits in common. "2e536d7040af58035c14cbc8e2ac95b785f6eec9" and "0651bd0118e73a5c8a9581dfe0313ecaa5ed1e0a" have entirely different histories.
2e536d7040
...
0651bd0118
9 changed files with 0 additions and 113 deletions
1
cli/.gitignore
vendored
1
cli/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
/target
|
|
||||||
7
cli/Cargo.lock
generated
7
cli/Cargo.lock
generated
|
|
@ -1,7 +0,0 @@
|
||||||
# This file is automatically @generated by Cargo.
|
|
||||||
# It is not intended for manual editing.
|
|
||||||
version = 4
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "snow"
|
|
||||||
version = "0.1.0"
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "snow"
|
|
||||||
description = "NixOS Derivative"
|
|
||||||
version = "0.1.0"
|
|
||||||
authors = ["_cry64 <them@dobutterfliescry.net>"]
|
|
||||||
edition = "2024"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
22
cli/LICENSE
22
cli/LICENSE
|
|
@ -1,22 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2026 _cry64 (Emile Clark-Boman)
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
use std::env;
|
|
||||||
|
|
||||||
mod rocli;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let args: Vec<String> = env::args().collect();
|
|
||||||
println!("Hello, world!");
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
pub struct Command {
|
|
||||||
pub name: String,
|
|
||||||
pub version: Option<String>,
|
|
||||||
|
|
||||||
pub action: Action,
|
|
||||||
|
|
||||||
pub subcommands: Vec<Commands>,
|
|
||||||
pub flags: Vec<Flag>,
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
mod command;
|
|
||||||
mod parse;
|
|
||||||
|
|
||||||
pub use parse::normalize_args;
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
/// Parse the GNU convention CLI argument syntax.
|
|
||||||
///
|
|
||||||
/// # Examples
|
|
||||||
/// ```rs
|
|
||||||
/// assert!(parse(vec!["--flag=value"]) == vec!["--flag", "value"]);
|
|
||||||
/// assert!(parse(vec!["--flag value"]) == vec!["--flag", "value"]);
|
|
||||||
/// assert!(parse(vec!["-abe"]) == vec!["-a", "-b", "-e"]);
|
|
||||||
/// assert!(parse(vec!["-abef=32"]) == vec!["-a", "-b", "-e", "-f", "32"]);
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// # Credit
|
|
||||||
/// Based on [github:ksk001100/seahorse `src/utils.rs`](https://github.com/ksk001100/seahorse/blob/master/src/utils.rs)
|
|
||||||
pub fn normalize_args(args: Vec<String>) -> Vec<String> {
|
|
||||||
args.iter().fold(Vec::<String>::new(), |mut acc, el| {
|
|
||||||
if !el.starts_with('-') {
|
|
||||||
acc.push(el.to_owned());
|
|
||||||
return acc;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut split = el.splitn(2, '=').map(|s| s.to_owned()).collect();
|
|
||||||
if el.starts_with("--") {
|
|
||||||
acc.append(&mut split);
|
|
||||||
} else {
|
|
||||||
let flags = split[0].chars().skip(1).map(|c| format!("-{c}"));
|
|
||||||
|
|
||||||
acc.append(&mut flags.collect());
|
|
||||||
if let Some(value) = split.get(1) {
|
|
||||||
acc.push(value.to_owned());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
acc
|
|
||||||
})
|
|
||||||
}
|
|
||||||
21
flake.lock
generated
21
flake.lock
generated
|
|
@ -185,30 +185,9 @@
|
||||||
"microvm": "microvm",
|
"microvm": "microvm",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nt": "nt",
|
"nt": "nt",
|
||||||
"sops-nix": "sops-nix",
|
|
||||||
"systems": "systems_3"
|
"systems": "systems_3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sops-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1772495394,
|
|
||||||
"narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=",
|
|
||||||
"owner": "Mic92",
|
|
||||||
"repo": "sops-nix",
|
|
||||||
"rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "Mic92",
|
|
||||||
"repo": "sops-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"spectrum": {
|
"spectrum": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue