Skip to content
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

contexts command #298

Merged
merged 4 commits into from Jan 6, 2023
Merged

contexts command #298

merged 4 commits into from Jan 6, 2023

Conversation

icepuma
Copy link
Member

@icepuma icepuma commented Jan 4, 2023

I'm submitting a

  • bug fix
  • feature
  • documentation addition

@icepuma icepuma requested review from a team, rawkode and martintc and removed request for a team January 4, 2023 19:22
@rawkode
Copy link
Member

rawkode commented Jan 4, 2023

@icepuma What do you think about hiding the env context behind an extra flag, such as contexts --include-env ?

@icepuma
Copy link
Member Author

icepuma commented Jan 4, 2023

Why? Too much output? We could truncate the lines to let's say 100 chars.

I don't really like a specific filter for dynamic envs.

@rawkode
Copy link
Member

rawkode commented Jan 4, 2023

My thoughts are that people can run env to see their environment variables, they don't need comtrya contexts for that and we should ensure we only show them useful information.

comtrya contexts could show

env:
-- hidden by default, add `--include-env` to display

os:
..

variables:
..

@icepuma icepuma marked this pull request as draft January 4, 2023 23:28
- cargo update
- cargo clippy
- refactor commands to have a common trait
- change context variable related logging from "DEBUG" to "TRACE"
@icepuma icepuma marked this pull request as ready for review January 6, 2023 00:09
@icepuma
Copy link
Member Author

icepuma commented Jan 6, 2023

❯ cargo run --bin=comtrya -- contexts 
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/comtrya contexts`
This command is a BETA feature. If you have any feedback: https://github.com/comtrya/comtrya/issues/304

env
 BROWSER              CARGO                               CARGO_HOME                CARGO_MANIFEST_DIR       CARGO_PKG_AUTHORS      CARGO_PKG_DESCRIPTION  
 CARGO_PKG_HOMEPAGE   CARGO_PKG_LICENSE                   CARGO_PKG_LICENSE_FILE    CARGO_PKG_NAME           CARGO_PKG_REPOSITORY   CARGO_PKG_RUST_VERSION 
 CARGO_PKG_VERSION    CARGO_PKG_VERSION_MAJOR             CARGO_PKG_VERSION_MINOR   CARGO_PKG_VERSION_PATCH  CARGO_PKG_VERSION_PRE  COLORTERM              
 CONDA_EXE            CONDA_SHLVL                         DBUS_SESSION_BUS_ADDRESS  DEBUGINFOD_URLS          DESKTOP_SESSION        DESKTOP_STARTUP_ID     
 DISPLAY              EDITOR                              GDMSESSION                GRADLE_HOME              GTK2_RC_FILES          GTK3_MODULES           
 GTK_MODULES          HAXE_STD_PATH                       HOME                      I3SOCK                   JAVA_HOME              KITTY_INSTALLATION_DIR 
 KITTY_PID            KITTY_PUBLIC_KEY                    KITTY_WINDOW_ID           LANG                     LC_ADDRESS             LC_IDENTIFICATION      
 LC_MEASUREMENT       LC_MONETARY                         LC_NAME                   LC_NUMERIC               LC_PAPER               LC_TELEPHONE           
 LC_TIME              LD_LIBRARY_PATH                     LESS_TERMCAP_mb           LESS_TERMCAP_md          LESS_TERMCAP_me        LESS_TERMCAP_se        
 LESS_TERMCAP_so      LESS_TERMCAP_ue                     LESS_TERMCAP_us           LOGNAME                  LS_COLORS              MAIL                   
 MOTD_SHOWN           NEON_DATABASE_URL                   OLDPWD                    OPENAI_API_KEY           PAGER                  PATH                   
 PWD                  QT_QPA_PLATFORMTHEME                RUSTUP_HOME               RUSTUP_TOOLCHAIN         RUST_RECURSION_COUNT   SHELL                  
 SHLVL                SHOW_AND_TELL_EDGE_DB_GITHUB_TOKEN  SSH_AUTH_SOCK             SSL_CERT_DIR             SSL_CERT_FILE          STARSHIP_SESSION_KEY   
 STARSHIP_SHELL       TERM                                TERMINFO                  USER                     WINDOWID               XAUTHORITY             
 XDG_CURRENT_DESKTOP  XDG_DATA_DIRS                       XDG_GREETER_DATA_DIR      XDG_RUNTIME_DIR          XDG_SEAT               XDG_SEAT_PATH          
 XDG_SESSION_CLASS    XDG_SESSION_DESKTOP                 XDG_SESSION_ID            XDG_SESSION_PATH         XDG_SESSION_TYPE       XDG_VTNR               
 _                                                                                                                                                         

include_variables
 <empty> 

os
 bitness      
 codename     
 distribution 
 edition      
 family       
 hostname     
 name         
 version      

user
 config_dir 
 home_dir   
 id         
 name       
 username   

variables
 <empty> 

@codecov-commenter
Copy link

Codecov Report

Base: 46.24% // Head: 46.13% // Decreases project coverage by -0.10% ⚠️

Coverage data is based on head (44317b7) compared to base (811a16b).
Patch coverage: 2.12% of modified lines in pull request are covered.

❗ Current head 44317b7 differs from pull request most recent head 10d5df4. Consider uploading reports for the commit 10d5df4 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #298      +/-   ##
==========================================
- Coverage   46.24%   46.13%   -0.11%     
==========================================
  Files          79       80       +1     
  Lines        2768     2796      +28     
==========================================
+ Hits         1280     1290      +10     
- Misses       1488     1506      +18     
Impacted Files Coverage Δ
app/src/commands/apply.rs 0.00% <0.00%> (ø)
app/src/commands/contexts.rs 0.00% <0.00%> (ø)
app/src/commands/version.rs 0.00% <0.00%> (ø)
app/src/main.rs 0.00% <0.00%> (ø)
lib/src/contexts/mod.rs 73.75% <50.00%> (ø)
lib/src/atoms/file/copy.rs 80.35% <100.00%> (+17.85%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@icepuma icepuma merged commit 6e9d08d into comtrya:main Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants