feat: add command-line interface and package management functionality
- Implemented a new CLI using Clap for managing Fedora configurations and packages. - Added commands for configuring dnf, adding repositories, installing RPM Fusion, adding users to groups, and managing packages. - Created data files for various package lists (AMD, Intel, common, firmware, gnome extra) and user groups. - Introduced Zsh completion script for improved command-line usability. - Removed the old CLI implementation and integrated the new structure into the main application logic.
This commit is contained in:
36
Makefile
Normal file
36
Makefile
Normal file
@@ -0,0 +1,36 @@
|
||||
ifeq ($(CARGO_PKG_VERSION),)
|
||||
CARGO_PKG_VERSION := 0.0.0
|
||||
endif
|
||||
|
||||
ifeq ($(APP_NAME),)
|
||||
APP_NAME := feddy
|
||||
endif
|
||||
|
||||
build: clean
|
||||
cargo build --release
|
||||
./target/release/$(APP_NAME) --generate=bash > completions.bash
|
||||
./target/release/$(APP_NAME) --generate=zsh > completions.zsh
|
||||
./target/release/$(APP_NAME) --generate=fish > completions.fish
|
||||
|
||||
clean:
|
||||
rm -f completions.bash
|
||||
rm -f completions.zsh
|
||||
rm -f completions.fish
|
||||
|
||||
format:
|
||||
cargo fmt --all
|
||||
|
||||
# PREFIX is environment variable, but if it is not set, then set default value
|
||||
ifeq ($(PREFIX),)
|
||||
PREFIX := /usr/local
|
||||
endif
|
||||
|
||||
install:
|
||||
install -d $(PREFIX)/bin/
|
||||
install -m 755 target/release/$(APP_NAME) $(PREFIX)/bin/
|
||||
install -d /usr/share/bash-completion/completions/
|
||||
install -m 644 completions.bash /usr/share/bash-completion/completions/$(APP_NAME)
|
||||
install -d /usr/share/zsh/site-functions/
|
||||
install -m 644 completions.zsh /usr/share/zsh/site-functions/_$(APP_NAME)
|
||||
install -d /usr/share/fish/vendor_completions.d/
|
||||
install -m 644 completions.fish /usr/share/fish/vendor_completions.d/$(APP_NAME).fish
|
||||
Reference in New Issue
Block a user