Skip to content

Revert "feat: adjust argument style ..." #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,6 @@ const DEFAULT_MIRROR: &str = "https://repo.aosc.io/debs";
#[derive(Parser, Debug)]
#[clap(about, version, author)]
struct Args {
/// Path to the destination
#[clap(long)]
target: String,
/// Mirror to be used
#[clap(short, long, conflicts_with = "sources_list")]
mirror: Option<String>,
/// Branch to use
#[clap(long, conflicts_with = "sources_list")]
branch: Option<String>,
/// Add additional components
#[clap(long, num_args = 1.., conflicts_with = "sources_list")]
comps: Option<Vec<String>>,
/// Use sources.list to fetch packages
#[clap(long)]
sources_list: Option<PathBuf>,
/// Sets a custom config file
#[clap(short, long)]
config: String,
Expand All @@ -71,6 +56,9 @@ struct Args {
/// Only finishes stage 1, do not progress further
#[clap(short = '1', long = "stage1-only")]
stage1: bool,
/// Add additional components
#[clap(long, num_args = 1.., conflicts_with = "sources_list")]
comps: Option<Vec<String>>,
/// Limit the number of parallel jobs
#[clap(short = 'j', long)]
jobs: Option<usize>,
Expand All @@ -86,12 +74,23 @@ struct Args {
/// Export a xz compressed squashfs archive
#[clap(long = "export-squashfs")]
squashfs: Option<String>,
/// Path to the destination
target: String,
/// Branch to use
#[clap(conflicts_with = "sources_list")]
branch: Option<String>,
/// Mirror to be used
#[clap(conflicts_with = "sources_list", default_value = DEFAULT_MIRROR)]
mirror: Option<String>,
/// Include topics
#[clap(short, long, num_args = 1..)]
topics: Option<Vec<String>>,
/// Disable Progress bar
#[clap(long)]
no_progressbar: bool,
/// Use sources.list to fetch packages
#[clap(long)]
sources_list: Option<PathBuf>,
}

fn get_default_arch() -> Vec<String> {
Expand Down Expand Up @@ -374,7 +373,7 @@ fn main() {
comps.push("main".to_string());
Some(comps)
} else {
None
Some(vec!["main".to_string()])
};

std::fs::create_dir_all(target_path.join("var/lib/apt/lists")).unwrap();
Expand Down