summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/args.rs4
-rw-r--r--src/main.rs9
2 files changed, 13 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs
index 7f7ca3a..03f6b51 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -17,6 +17,10 @@ pub enum Command {
/// Removes an AppImage
#[command(name = "remove", alias = "rm")]
Remove(RemoveArgs),
+
+ /// List the installed AppImages
+ #[command(name = "list", alias = "ls")]
+ List,
}
#[derive(Debug, Args)]
diff --git a/src/main.rs b/src/main.rs
index 3092c43..4c3d5d7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -42,6 +42,15 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
appimage.remove().await?;
}
+ Command::List => {
+ let mut appimages = fs::read_dir(index_dir()).await?;
+
+ while let Some(appimage) = appimages.next_entry().await? {
+ if let Some(name) = appimage.file_name().to_str() {
+ println!("- {}", name.strip_suffix(".json").unwrap());
+ }
+ }
+ }
};
Ok(())