added command-line argument to specify executable path

CrepeGoat
Oct 10, 2024, 2:51 AM
PL4TK55O7SBKFBNDO3WIRYLU5LBHRJV7BCD7SMBIVKEP2SCJGFFAC

Dependencies

  • [2] 6ECOC7L5 parsed `pijul channel` text blob into individual UI components
  • [3] IQY5LHEN add GUI element to display simple `pijul log` results
  • [4] G2CHQAOP parsed `pijul log` text blob into individual entries & fields
  • [5] HZV5P57Y changed channel and log views to use `ListView` (looks much cleaner)
  • [6] 4RPYR65C connect GUI to pijul to display simple channel list
  • [7] NSE6BLWA init slint project from https://github.com/slint-ui/slint-rust-template
  • [*] NCRTU7M4 cargo init

Change contents

  • edit in ui/app-window.slint at line 77
    [2.261][2.261:294]()
    preferred-width: 150px;
  • edit in ui/app-window.slint at line 105
    [3.161]
    [2.792]
    in property <string> exe_path;
  • edit in src/main.rs at line 15
    [3.347]
    [3.804]
    let cli_args: CLIArgs = argh::from_env();
  • edit in src/main.rs at line 18
    [3.836]
    [3.836]
    ui.set_exe_path(cli_args.exe_path.into());
  • replacement in src/main.rs at line 24
    [3.969][3.382:498](),[3.498][3.498:566](),[3.566][3.566:581]()
    let channel_output = channel(
    Path::new("/Users/beckerawqatty/.nix-profile/bin/pijul"),
    Path::new("/Users/beckerawqatty/Repos/pijul-gui/"),
    );
    [3.969]
    [3.581]
    let exe_path_string = ui.get_exe_path();
    let exe_path = Path::new(exe_path_string.as_str());
    let repo_path = Path::new("/Users/beckerawqatty/Repos/pijul-gui/");
    let channel_output = channel(exe_path, repo_path);
  • replacement in src/main.rs at line 52
    [3.1193][3.1193:1301](),[3.1301][3.1301:1369](),[3.1369][3.1369:1384]()
    let log_output = log(
    Path::new("/Users/beckerawqatty/.nix-profile/bin/pijul"),
    Path::new("/Users/beckerawqatty/Repos/pijul-gui/"),
    );
    [3.1193]
    [3.1384]
    let exe_path_string = ui.get_exe_path();
    let exe_path = Path::new(exe_path_string.as_str());
    let repo_path = Path::new("/Users/beckerawqatty/Repos/pijul-gui/");
    let log_output = log(exe_path, repo_path);
  • edit in src/main.rs at line 88
    [9.95]
    /// A GUI frontend for the `pijul` program.
    #[derive(argh::FromArgs)]
    struct CLIArgs {
    /// the file path of the `pijul` executable
    #[argh(option, default = "\"pijul\".to_string()")]
    exe_path: String,
    }
  • edit in Cargo.toml at line 12
    [3.2356]
    [3.1931]
    argh = "0.1.12"
  • edit in Cargo.lock at line 198
    [3.2162]
    [3.6025]
    [[package]]
    name = "argh"
    version = "0.1.12"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "7af5ba06967ff7214ce4c7419c7d185be7ecd6cc4965a8f6e1d8ce0398aad219"
    dependencies = [
    "argh_derive",
    "argh_shared",
    ]
    [[package]]
    name = "argh_derive"
    version = "0.1.12"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "56df0aeedf6b7a2fc67d06db35b09684c3e8da0c95f8f27685cb17e08413d87a"
    dependencies = [
    "argh_shared",
    "proc-macro2",
    "quote",
    "syn",
    ]
    [[package]]
    name = "argh_shared"
    version = "0.1.12"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "5693f39141bda5760ecc4111ab08da40565d1771038c4a0250f03457ec707531"
    dependencies = [
    "serde",
    ]
  • edit in Cargo.lock at line 2835
    [3.2174]
    [3.2357]
    "argh",