ngx-security-audit 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -174,19 +174,19 @@ program
174
174
  console.log('Created .ngsecurityrc.json with default configuration.');
175
175
  });
176
176
 
177
- // Default command - scan current directory
178
- program
179
- .argument('[path]', 'Path to Angular project (shorthand for "scan" command)')
180
- .option('-f, --format <format>', 'Report format', 'console')
181
- .option('-o, --output <file>', 'Write report to file')
182
- .option('-t, --threshold <level>', 'Fail threshold', 'high')
183
- .option('-v, --verbose', 'Verbose output')
184
- .action(async (projectPath, options) => {
185
- // If no subcommand, run scan
186
- if (projectPath && !['scan', 'rules', 'init'].includes(projectPath)) {
187
- await program.commands.find((c) => c.name() === 'scan')
188
- .parseAsync([process.argv[0], process.argv[1], 'scan', projectPath, ...process.argv.slice(3)]);
189
- }
190
- });
177
+ // Enable passthrough so parent doesn't steal subcommand options
178
+ program.enablePositionalOptions();
179
+ program.passThroughOptions();
180
+
181
+ // Default action: if invoked without a subcommand, delegate to "scan"
182
+ program.action(async () => {
183
+ // Collect everything after the program name that wasn't a known subcommand
184
+ const args = process.argv.slice(2);
185
+ if (args.length > 0 && !['scan', 's', 'rules', 'init', '--help', '-h', '--version', '-V'].includes(args[0])) {
186
+ // Treat as: ngx-security-audit scan <args...>
187
+ const scanCmd = program.commands.find((c) => c.name() === 'scan');
188
+ await scanCmd.parseAsync(args, { from: 'user' });
189
+ }
190
+ });
191
191
 
192
192
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-security-audit",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Enterprise-grade Angular security auditing tool. Static analysis scanner that detects XSS, CSRF, injection, sensitive data exposure, misconfigurations and 40+ security vulnerabilities in Angular projects. Generates detailed reports with severity levels for CI/CD pipeline integration.",
5
5
  "main": "src/index.js",
6
6
  "bin": {