Skip to content

Conversation

@Miauwkeru
Copy link
Contributor

@Miauwkeru Miauwkeru commented Nov 12, 2024

There was an issue with the TargetCmd in the case the prompt was defined in the config file, yet didn't contain {cmd} or {base}. This fixes that issue

and some fixes for typing consistency

@codecov
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 79.16%. Comparing base (bb9a488) to head (2a93fe1).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dissect/target/tools/shell.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #943      +/-   ##
==========================================
- Coverage   79.17%   79.16%   -0.01%     
==========================================
  Files         344      344              
  Lines       30350    30352       +2     
==========================================
  Hits        24029    24029              
- Misses       6321     6323       +2     
Flag Coverage Δ
unittests 79.16% <40.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

def do_man(self, line: str) -> bool:
"""alias for help"""
self.do_help(line)
return True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it should return False. If a do_ or cmd_ function returns True it is a sign the Cli should exit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aah, TIL. Will change it

Copy link
Contributor

@JSCU-CNI JSCU-CNI Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of counter intuitive if you ask me, but that's how it works 😅. Perhaps it is inspired by 0 and 1 exit codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it definitely feels counterintuitive. I guess its the exit code thing to make it feel like a shell where a non zero value gets treated as an error. Anyway, fixed!

Schamper
Schamper previously approved these changes Apr 2, 2025
@Miauwkeru Miauwkeru force-pushed the fixes-target-shell branch 2 times, most recently from 7d89a00 to 98af1a9 Compare April 2, 2025 12:27
@Miauwkeru Miauwkeru requested a review from Schamper April 2, 2025 12:27
@Miauwkeru Miauwkeru force-pushed the fixes-target-shell branch from 98af1a9 to 2a93fe1 Compare April 2, 2025 13:07
@Miauwkeru Miauwkeru merged commit fe32d50 into main Apr 2, 2025
17 of 22 checks passed
@Miauwkeru Miauwkeru deleted the fixes-target-shell branch April 2, 2025 14:02
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.

4 participants