config config config
This commit is contained in:
1 parent
8ed2407463
commit
bb0072a6f6
4 files changed
+29
-17
No files matched your search
@@ -14,4 +14,8 @@
|
||||
const style_t directory_style[DIR_STYLE_NUM] = { style_bold };
|
||||
const uint32_t directory_colour = 0x6CA05C;
|
||||
|
||||
#define EXEC_STYLE_NUM ( ( int )1 )
|
||||
const style_t exec_style[EXEC_STYLE_NUM] = { style_none };
|
||||
const uint32_t exec_colour = 0x34AD1F;
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -26,7 +26,7 @@ typedef enum {
|
||||
style_reversed,
|
||||
style_invisible,
|
||||
style_strikethrough,
|
||||
style_end = NUMBER_STYLES
|
||||
style_none = NUMBER_STYLES
|
||||
} style_t;
|
||||
|
||||
|
||||
|
||||
+8
-4
@@ -15,13 +15,17 @@ void format_clear( void )
|
||||
|
||||
void format_set_style( const style_t* const styles, uint8_t number )
|
||||
{
|
||||
if ( NUMBER_STYLES < number )
|
||||
return;
|
||||
if ( NUMBER_STYLES < number ) return;
|
||||
if ( style_none == styles[ 0 ] ) return;
|
||||
|
||||
fprintf( stdout, SEQUENCE_PREFIX );
|
||||
for ( int n = 0; n < number; n++ )
|
||||
{
|
||||
style_t style = styles[ n ];
|
||||
|
||||
if ( style_none <= style )
|
||||
continue;
|
||||
|
||||
if ( n >= number - 1 )
|
||||
{
|
||||
fprintf( stdout, "%d", STYLE_SET[ style ] );
|
||||
@@ -36,8 +40,8 @@ void format_set_style( const style_t* const styles, uint8_t number )
|
||||
|
||||
void format_reset_style( const style_t* const styles, uint8_t number )
|
||||
{
|
||||
if ( NUMBER_STYLES < number )
|
||||
return;
|
||||
if ( NUMBER_STYLES < number ) return;
|
||||
if ( style_none == styles[ 0 ] ) return;
|
||||
|
||||
fprintf( stdout, SEQUENCE_PREFIX );
|
||||
for ( int n = 0; n < number; n++ )
|
||||
|
||||
+16
-12
@@ -341,19 +341,10 @@ int display_directory_contents(
|
||||
);
|
||||
size_to_string( entry, &file_size[ 0 ], LENGTH_SIZE );
|
||||
|
||||
if ( !args->tree_view )
|
||||
{
|
||||
log_info(
|
||||
"%c%s%s %s",
|
||||
file_type,
|
||||
file_permissions,
|
||||
file_size,
|
||||
entry->name
|
||||
);
|
||||
}
|
||||
else
|
||||
if ( args->tree_view )
|
||||
{
|
||||
char tree[ NAME_MAX ] = "";
|
||||
|
||||
for ( size_t k = 0; k < recursion_level; k++ )
|
||||
{
|
||||
if ( !( is_last & 1 << k ) )
|
||||
@@ -381,6 +372,7 @@ int display_directory_contents(
|
||||
tree[ 4 * recursion_level + 3 ] = ' ';
|
||||
|
||||
fprintf( stdout, "%s", tree );
|
||||
}
|
||||
|
||||
if ( entry->type == type_directory )
|
||||
{
|
||||
@@ -395,6 +387,19 @@ int display_directory_contents(
|
||||
}
|
||||
fprintf( stdout, "\n" );
|
||||
|
||||
// if ( !args->tree_view )
|
||||
// {
|
||||
// log_info(
|
||||
// "%c%s%s %s",
|
||||
// file_type,
|
||||
// file_permissions,
|
||||
// file_size,
|
||||
// entry->name
|
||||
// );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
if ( recursion_level < args->depth
|
||||
&& entry->type == type_directory )
|
||||
{
|
||||
@@ -418,7 +423,6 @@ int display_directory_contents(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// free all allocated elements/entries
|
||||
for ( int n = 0; n < num_entries; n++ )
|
||||
|
||||
Reference in new issue
Block a user