Subversion Repositories SvarDOS

Rev

Rev 420 | Rev 424 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 420 Rev 421
Line -... Line 1...
-
 
1
/* This file is part of the SvarCOM project and is published under the terms
-
 
2
 * of the MIT license.
-
 
3
 *
-
 
4
 * Copyright (C) 2021 Mateusz Viste
-
 
5
 *
-
 
6
 * Permission is hereby granted, free of charge, to any person obtaining a
-
 
7
 * copy of this software and associated documentation files (the "Software"),
-
 
8
 * to deal in the Software without restriction, including without limitation
-
 
9
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-
 
10
 * and/or sell copies of the Software, and to permit persons to whom the
-
 
11
 * Software is furnished to do so, subject to the following conditions:
-
 
12
 *
-
 
13
 * The above copyright notice and this permission notice shall be included in
-
 
14
 * all copies or substantial portions of the Software.
-
 
15
 *
-
 
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-
 
17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-
 
18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-
 
19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-
 
20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-
 
21
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-
 
22
 * DEALINGS IN THE SOFTWARE.
-
 
23
 */
-
 
24
 
1
/*
25
/*
2
 * dir
26
 * dir
3
 *
27
 *
4
 * Displays a list of files and subdirectories in a directory.
28
 * Displays a list of files and subdirectories in a directory.
5
 *
29
 *
Line 68... Line 92...
68
    outputnl("    D by date                G group dirs first       - prefix to reverse order");
92
    outputnl("    D by date                G group dirs first       - prefix to reverse order");
69
    outputnl("");
93
    outputnl("");
70
    outputnl("/S Displays files in specified directory and all subdirectories");
94
    outputnl("/S Displays files in specified directory and all subdirectories");
71
    outputnl("/B Uses bare format (no heading information or summary)");
95
    outputnl("/B Uses bare format (no heading information or summary)");
72
    outputnl("/L Uses lowercases");
96
    outputnl("/L Uses lowercases");
73
 
-
 
74
    /* TODO FIXME REMOVE THIS ONCE ALL IMPLEMENTED */
-
 
75
    outputnl("\r\n*** THIS COMMAND IS NOT FULLY IMPLEMENTED YET ***");
-
 
76
 
-
 
77
    return(-1);
97
    return(-1);
78
  }
98
  }
79
 
99
 
80
  i = nls_getpatterns(nls);
100
  i = nls_getpatterns(nls);
81
  if (i != 0) outputnl(doserr(i));
101
  if (i != 0) outputnl(doserr(i));
Line 98... Line 118...
98
          break;
118
          break;
99
        case 'b':
119
        case 'b':
100
        case 'B':
120
        case 'B':
101
          format = DIR_OUTPUT_BARE;
121
          format = DIR_OUTPUT_BARE;
102
          break;
122
          break;
103
        case 'w':
123
        case 'l':
104
        case 'W':
124
        case 'L':
105
          format = DIR_OUTPUT_WIDE;
125
          flags |= DIR_FLAG_LCASE;
-
 
126
          break;
-
 
127
        case 'o':
-
 
128
        case 'O':
-
 
129
          /* TODO */
-
 
130
          outputnl("/O NOT IMPLEMENTED YET");
-
 
131
          return(-1);
106
          break;
132
          break;
107
        case 'p':
133
        case 'p':
108
        case 'P':
134
        case 'P':
109
          flags |= DIR_FLAG_PAUSE;
135
          flags |= DIR_FLAG_PAUSE;
110
          if (neg) flags &= (0xff ^ DIR_FLAG_PAUSE);
136
          if (neg) flags &= (0xff ^ DIR_FLAG_PAUSE);
111
          break;
137
          break;
-
 
138
        case 's':
112
        case 'l':
139
        case 'S':
-
 
140
          /* TODO */
-
 
141
          outputnl("/S NOT IMPLEMENTED YET");
-
 
142
          return(-1);
-
 
143
          break;
-
 
144
        case 'w':
113
        case 'L':
145
        case 'W':
114
          flags |= DIR_FLAG_LCASE;
146
          format = DIR_OUTPUT_WIDE;
115
          break;
147
          break;
116
        default:
148
        default:
117
          outputnl("Invalid switch");
149
          outputnl("Invalid switch");
118
          return(-1);
150
          return(-1);
119
      }
151
      }