- prompt = argv[0];
- while ((argc > 1) && (argv[1][0] == '-')) {
- if (!strcmp(argv[1], "-d")) {
- debug = 1;
- } else if (!strcmp(argv[1], "-n")) {
- if ((argc > 1) && (argv[2][0] != '-')) { /* get file name */
- NetTrace = fopen(argv[2], "w");
- argv++;
- argc--;
- if (NetTrace == NULL) {
- NetTrace = stdout;
+ user = NULL;
+ autologin = 0;
+ while ((ch = getopt(argc, argv, "ade:l:n:")) != EOF)
+ switch(ch) {
+ case 'a':
+ autologin = 1;
+ break;
+ case 'd':
+ debug = 1;
+ break;
+ case 'e':
+ set_escape_char(optarg);
+ break;
+ case 'l':
+ autologin = 1;
+ user = optarg;
+ break;
+ case 'n':
+#if defined(TN3270) && defined(unix)
+ /* distinguish between "-n oasynch" and "-noasynch" */
+ if (argv[optind - 1][0] == '-' && argv[optind - 1][1]
+ == 'n' && argv[optind - 1][2] == 'o') {
+ if (!strcmp(optarg, "oasynch")) {
+ noasynchtty = 1;
+ noasynchnet = 1;
+ } else if (!strcmp(optarg, "oasynchtty"))
+ noasynchtty = 1;
+ } else if (!strcmp(optarg, "oasynchnet"))
+ noasynchnet = 1;
+ }
+ } else
+#endif /* defined(TN3270) && defined(unix) */
+ SetNetTrace(optarg);
+ break;
+#if defined(TN3270) && defined(unix)
+ case 't':
+ transcom = tline;
+ (void)strcpy(transcom, optarg);
+ break;
+#endif
+ case '?':
+ default:
+ usage();
+ /* NOTREACHED */