/*
- * udevtrigger.c
- *
* Copyright (C) 2004-2006 Kay Sievers <kay@vrfy.org>
* Copyright (C) 2006 Hannes Reinecke <hare@suse.de>
*
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
int main(int argc, char *argv[], char *envp[])
{
int i;
+ int failed = 0;
logging_init("udevtrigger");
udev_config_init();
} else if (strcmp(arg, "--dry-run") == 0 || strcmp(arg, "-n") == 0) {
dry_run = 1;
} else if (strcmp(arg, "--retry-failed") == 0 || strcmp(arg, "-F") == 0) {
- scan_failed();
- exec_lists();
+ failed = 1;
+ } else if (strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0) {
+ printf("Usage: udevtrigger [--help] [--verbose] [--dry-run] [--retry-failed]\n");
goto exit;
} else {
- fprintf(stderr, "Usage: udevtrigger [--verbose] [--dry-run] [--retry-failed]\n");
- goto exit;
+ fprintf(stderr, "unrecognized option '%s'\n", arg);
+ err("unrecognized option '%s'\n", arg);
}
}
- /* default action */
- scan_bus();
- scan_class();
- scan_block();
+ if (failed)
+ scan_failed();
+ else {
+ /* default action */
+ scan_bus();
+ scan_class();
+ scan_block();
+ }
exec_lists();
exit: