Updated the logic to correctly handle combined short flags like -pn and -np.
The -n flag is only honored when it's either:
1. A standalone flag (-n or --number)
2. The last flag in a combined form that includes -p (e.g., -pn), or
3. In a combined form without -p (e.g., -An)
This ensures that -np (where -p overrides -n) correctly produces plain output,
while -pn (where -n overrides -p) produces line numbers.